package com.codechuan.hallo_web.controller;

import com.codechuan.hallo_web.service.JtApiService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.HashMap;

/**
 * @Deprecated 鸡腿项目接口
 */
@RestController
@RequestMapping(value = "/jt")
public class JtApiController {

    @Resource
    private JtApiService jtApiService;

    /**
     * @param hashMap 参数
     * @return 返回成功或者失败的消息
     * @Deprecated 卡密登录接口
     */
    @PostMapping(value = "/loginJt")
    public String loginJt(@RequestBody HashMap<String, String> hashMap) {
       return jtApiService.login(hashMap);
    }

    /**
     * @param hashMap 参数
     * @return 返回配置文件实体类
     * @Deprecated 读取鸡腿用户卡密配置
     */
    @PostMapping(value = "/getJtUserConfig")
    public String getJtUserConfig(@RequestBody HashMap<String, String> hashMap) {
        return jtApiService.getJtUserConfig(hashMap);
    }

    /**
     * @param hashMap 参数
     * @return 返回到期时间
     * @Deprecated 获取用户到期时间
     */
    @PostMapping(value = "/selectUserExitTime")
    public String selectUserExitTime(@RequestBody HashMap<String, String> hashMap) {
        return jtApiService.selectUserExitTime(hashMap);
    }


    // 首页接口

    /**
     * @param hashMap phone 手机号
     * @return 返回主号信息
     * @Deprecated 获取用户主号token信息
     */
    @PostMapping(value = "/getUserAccount")
    public String getUserAccount(@RequestBody HashMap<String, String> hashMap) {
        return jtApiService.getUserAccount(hashMap);
    }


    /**
     * @param hashMap 用户账号
     * @Deprecated 修改用户表中的token和ticket
     */
    @PostMapping(value = "/updateAccountToken")
    public String updateAccountToken(@RequestBody HashMap<String, String> hashMap) {
        return jtApiService.updateAccountToken(hashMap);
    }

    /**
     * @Deprecated 获取指定城市编码
     */
    @PostMapping(value = "/selectPcCsCityCode")
    public String selectZdCsCityCode(@RequestBody HashMap<String, String> hashMap) {
        return jtApiService.selectZdCsCityCode(hashMap);
    }

    /**
     * @Deprecated 修改主号状态
     */
    @PostMapping(value = "/updateAccountTokenStatus")
    public String updateAccountTokenStatus(@RequestBody HashMap<String, String> hashMap) {
        return jtApiService.updateAccountTokenStatus(hashMap);
    }

    /**
     * @Deprecated 保存用户配置文件
     */
    @PostMapping(value = "/saveAccountConfig")
    public String saveAccountConfig(@RequestBody HashMap<String, String> hashMap) {
        return jtApiService.saveAccountConfig(hashMap);
    }


    /**
     * @Deprecated 获取用户订单集合
     */
    @PostMapping(value = "/getUserOrderList")
    public String getUserOrderList(@RequestBody HashMap<String, String> hashMap) {
        return jtApiService.getUserOrderList(hashMap);
    }

    /**
     * @Deprecated 删除所有用户订单
     */
    @PostMapping(value = "/deleteOrderInfo")
    public String deleteOrderInfo(@RequestBody HashMap<String, String> hashMap) {
        return jtApiService.deleteOrderInfo(hashMap);
    }

    /**
     * @Deprecated 新增用户订单
     */
    @PostMapping(value = "/addUserOrder")
    public String addUserOrder(@RequestBody HashMap<String, String> hashMap) {
        return jtApiService.addUserOrder(hashMap);
    }

    /**
     * @Deprecated 鸡腿解绑
     */
    @PostMapping(value = "/jtNoBind")
    public String jtNoBind(@RequestBody HashMap<String, String> hashMap) {
        return jtApiService.jtNoBind(hashMap);
    }
}
